package cn.tedu.bonfire.front.content.dao.search.impl;

import cn.tedu.bonfire.common.pojo.po.TagAdminSearchPO;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.core.SearchPage;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

public interface TagElasticsearchRepositoryImpl extends ElasticsearchRepository<TagAdminSearchPO, Long> {
    @Query("{\n" +
            "  \"bool\": {\n" +
            "    \"should\": [\n" +
            "      {\n" +
            "        \"match\": {\n" +
            "          \"tagName\": {\n" +
            "            \"query\": \"?0\"\n" +
            "          }\n" +
            "        }\n" +
            "      }\n" +
            "    ]\n" +
            "  }\n" +
            "}")
    SearchPage<TagAdminSearchPO> customSearch(String keyword, Pageable pageable);
}

